#include "precompiled.hpp"
#include "parse.hpp"
#include "exec_context.hpp"

int main(int argc, char **argv)
{	
	if (argc<2)
	{
		std::cerr<<"Not enough arguments for JAMRUNNER!"<<std::endl;
		return 1;
	}

	try
	{
		jam_context_ptr ctx=jam_context::new_context();
		parse_context parser(argv[1],false,false);
		parser.parse();

		jam_list res;
		ctx->intepret_tree(parser.root_.get(),jam_module_ptr(),&res);
	}catch(const jam_exception &ex)
	{
		if (argc<3 || strcmp(argv[2],"-noexception_text")!=0)
			std::cerr<<ex.what()<<std::endl;
		return 1;
	}

	return 0;
}
